package listbyorder.access001_100.test27;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/5/29 17:24
 */
public class Solution1 {

    // 双指针
    public int removeElement(int[] nums, int val) {
        int i = 0;
        for (int j = 0; j < nums.length; j++) {
            if (nums[j] != val) {
                nums[i++] = nums[j];
            }
        }
        return i;
    }
}
